import React, { useState, useEffect } from 'react'
import store from './redux/store'
import Count from './Count'
import Test from './Test'
export default function App() {
  const [x, setX] = useState(0)
  useEffect(() => {
    store.subscribe(() => {
      //   console.log(store.getState())
      // 只要这个函数执行,意味着redux数据变化, 就需要让Count组件更新
      setX((x) => {
        return x + 1
      })
    })
  }, [])
  return (
    <div>
      App
      <hr />
      <Count></Count>
      <hr />
      <Test></Test>
    </div>
  )
}
